#include "comm.hpp"

extern Log log;

int main()
{
	// sleep(5);
	int shmid = CreateShm();
	// log(Debug, "create success");

	// sleep(5);
	char* shmaddr = (char*)shmat(shmid, nullptr, 0);
	// log(Debug, "attach success, shmaddr: 0x%x", shmaddr);

	while (true)
	{
		cout << "client say# " << shmaddr << endl;
		sleep(1);
	}

	// sleep(5);
	shmdt(shmaddr);
	// log(Debug, "deattch shm done");

	// sleep(5);
	shmctl(shmid, IPC_RMID, nullptr);
	// log(Debug, "destory shm done");

	// sleep(5);
	// log(Debug, "processa quit ...");

	return 0;
}